package com.example.demodb.service;

import com.example.demodb.entity.Song;
import com.example.demodb.entity.SongSong;
import com.example.demodb.entity.User;
import com.example.demodb.entity.UserSong;
import com.example.demodb.repository.ISongRepository;
import com.example.demodb.repository.ISongSongRepository;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SongSongService { //service可以抽象成接口
    @Resource
    private ISongSongRepository songSongRepository;

    public void update(SongSong songSong){
        songSongRepository.save(songSong);//覆盖
    }
    public void delete(Long id){
         songSongRepository.deleteById(id);
    }
    public List<SongSong> findAll(){
        return songSongRepository.findAll();
    }



}
